package com.eclipse.e20200122_反射.反射_获取对象;

public class Test {
	public static void main(String[] args) throws ClassNotFoundException, InstantiationException, IllegalAccessException {
		
		Class clas = Student.class;
		Student student = (Student) clas.newInstance();
		System.out.println(student.sex);
		
		
	}
}

class Student{
	String sex = "nv";

	public String getSex() {
		return sex;
	}

	public void setSex(String sex) {
		this.sex = sex;
	}
	
	
}